package com.higgins.eventtracking.server.dataModel;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.higgins.eventtracking.client.dto.BodyStatsDTO;
import com.higgins.eventtracking.client.dto.DynamicTypeDTO;
import com.higgins.eventtracking.client.dto.HealthEventDTO;
import com.higgins.eventtracking.client.dto.QuestionDTO;

@PersistenceCapable
public class DynamicType {
	@SuppressWarnings("unused")
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
	
	@Persistent
	private Date timestamp;
	
	@Persistent
	private String category;
	
	@Persistent
	private String dynamicType;
	
	@Persistent
	private Boolean subType;
	
	@Persistent
	private String subCategory;
	


	public DynamicType(DynamicTypeDTO dto)	{
		this.id = dto.getId();
		this.timestamp = dto.getTimestamp();
		this.category = dto.getCategory();
		this.dynamicType = dto.getDynamicType();
		this.subType = dto.getSubType();
		this.subCategory = dto.getSubCategory();
	}
	public DynamicType()	{
		
	}
	public Long getId()	{
		return id;
	}
	public void setTimestamp(Date timestamp)	{
		this.timestamp = timestamp;
	}
	public Date getTimestamp()	{
		return timestamp;
	}
	public void setCategory(String category)	{
		this.category = category;
	}
	public String getCategory()	{
		return category;
	}

	public DynamicTypeDTO toDTO()	{
		return new DynamicTypeDTO(id, timestamp, category, dynamicType, subType, subCategory);
	}
	public void update(DynamicTypeDTO dto)	{
		this.timestamp = dto.getTimestamp();
		this.category = dto.getCategory();
		this.dynamicType = dto.getDynamicType();
		this.subType = dto.getSubType();
		this.subCategory = dto.getSubCategory();
	}
}
